package eteam.aps.systeminterface.model.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;

import javax.validation.GroupSequence;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

@Data
@ApiModel(value = "角色信息")
@GroupSequence({Insert.class, Update.class, RoleDto.class})
public class RoleDto implements Serializable {
    @ApiModelProperty("角色ID")
    @NotBlank(message = "角色ID为空", groups = Update.class)
    public String fuserid;
    @ApiModelProperty("角色编码")
    @NotBlank(message = "角色编码为空", groups = {Insert.class, Update.class})
    public String fusername;
    //@ApiModelProperty("密码")
    // public String fpassword;
    @ApiModelProperty("角色全称")
    @NotBlank(message = "角色全称为空", groups = {Insert.class, Update.class})
    public String ffullname;
    //@ApiModelProperty("0:用户 2:角色 默认两个角色: Administrators, AppUser")
    //public Integer fpersontype;
    //@ApiModelProperty("人员ID")
    // public String fpersonid;
    //@ApiModelProperty("用户组对应机构")
    // public String fgrouporgid;
    @ApiModelProperty("角色适用机构类型：0机构，10部门，20班组")
    @NotNull(message = "角色适用机构不合法", groups = {Insert.class, Update.class})
    @Max(value = 20, message = "角色适用机构不合法", groups = {Insert.class, Update.class})
    @Min(value = 0, message = "角色适用机构不合法", groups = {Insert.class, Update.class})
    public Integer funittypeid;

    //@ApiModelProperty("录入人")
    // public String fcreator;
    // @ApiModelProperty("录入人姓名")
    // public String fcreatorname;
    // @ApiModelProperty("录入时间")
    // public Date fcreatetime;
    // @ApiModelProperty("最后修改人")
    // public String flastmodifier;
    // @ApiModelProperty("最后修改人姓名")
    // public String flastmodifiername;
    // @ApiModelProperty("最后修改时间")
    // public Date flastmodifytime;
    // @ApiModelProperty("时间戳")
    // public Date ftimestamp;

    @ApiModelProperty("权限：0无权限 1本部门 2本部门及以下 99无限制")
    @NotNull(message = "数据权限不合法", groups = {Insert.class, Update.class})
    @Max(value = 99, message = "数据权限不合法", groups = {Insert.class, Update.class})
    @Min(value = 0, message = "数据权限不合法", groups = {Insert.class, Update.class})
    public Integer fpermission;
    @ApiModelProperty("状态【-1删除 0停用 1启用】")
    @NotNull(message = "状态不合法", groups = {Insert.class, Update.class})
    @Max(value = 1, message = "状态不合法", groups = {Insert.class, Update.class})
    @Min(value = -1, message = "状态不合法", groups = {Insert.class, Update.class})
    public Integer state;
}

